package com.example.studentmanagmentsystem;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

public class ActivityCollector {
    public static List<Activity> activities = new ArrayList<>();
    public static void addActivity(Activity activity){//添加一个
        activities.add(activity);
    }

    public static void removeActivity(Activity activity){//删除一个
        activities.remove(activity);
    }

    public static void finishAll() {//结束所有Activity
        for (Activity activity :activities){
            if (!activity.isFinishing()){
                activity.finish();
            }
        }
    }
}
